import { AxiosPromise } from 'axios'
import request from '@/hooks/utils/http'

export class SysOperLogService {
  /**
   * 删除数据集定义
   */
  static del = (ids: Array<string | number> | string | number) => {
    return request({
      url: '/sys/oper/log/' + ids,
      method: 'delete'
    })
  }
  /**
   * 新增数据集定义
   */
  static add = (data: any) => {
    return request({
      url: '/sys/oper/log',
      method: 'post',
      data: data
    })
  }
  /**
   * 修改数据集定义
   * @param data
   */
  static update = (data: any) => {
    return request({
      url: '/sys/oper/log',
      method: 'put',
      data: data
    })
  }
  /**
   * 查询数据集定义详细
   */
  static get = (id: string | number): AxiosPromise<SysOperLogVO> => {
    return request({
      url: '/sys/oper/log/' + id,
      method: 'get'
    })
  }
  /**
   * 获取数据集定义列表
   */
  static list = (query: SysOperLogQuery): AxiosPromise<SysOperLogVO[]> => {
    return request({
      url: '/sys/oper/log/list',
      method: 'get',
      params: query
    })
  }
}

export interface SysOperLogVO extends BaseEntity {
  id: string | number
  operId: long
  tenantId: string
  title: string
  businessType: integer
  method: string
  requestMethod: string
  operatorType: integer
  operName: string
  deptName: string
  operUrl: string
  operIp: string
  operLocation: string
  operParam: string
  jsonResult: string
  status: integer
  errorMsg: string
  operTime: date
  costTime: long
}

export interface SysOperLogQuery extends PageQuery {
  operId: long
  tenantId: string
  title: string
  businessType: integer
  method: string
  requestMethod: string
  operatorType: integer
  operName: string
  deptName: string
  operUrl: string
  operIp: string
  operLocation: string
  operParam: string
  jsonResult: string
  status: integer
  errorMsg: string
  operTime: date
  costTime: long
}

export interface SysOperLogForm {
  id: string | number
  operId: long
  tenantId: string
  title: string
  businessType: integer
  method: string
  requestMethod: string
  operatorType: integer
  operName: string
  deptName: string
  operUrl: string
  operIp: string
  operLocation: string
  operParam: string
  jsonResult: string
  status: integer
  errorMsg: string
  operTime: date
  costTime: long
}
